import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description: 俩数之和
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2023-08-04  19:51
 */
public class Test5 {
    public static void main(String[] args) {
        int[] array = {1,2,3,4,5};
        int[] ret = findNUm(array,4);
        System.out.println(Arrays.toString(ret));
    }

    public static int[] findNUm(int[] array, int target) {
        int[] ret = {-1,-1};
        for (int i = 0; i < array.length; i++) {
            for (int j = i+1; j < array.length; j++) {
                if(array[i] + array [j] == target) {
                    ret[0] = i;
                    ret[1] = j;
                }
            }
        }
        return ret;
    }
}
